package com.zqx.消费生产模式;

import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingQueue;


public class test {
public static void main(String[] args)  {

	BlockingQueue<Integer> dataQueue = new LinkedBlockingQueue<Integer>(10);
	
	Producer producer = new Producer(dataQueue);
    // 生产者二号
    Producer producer2 = new Producer(dataQueue);
    // 消费者
    Customer consumer = new Customer(dataQueue);
    for (int i = 0; i < 15; i++) {
        new Thread(producer).start();
    }

    for (int i = 0; i < 15; i++) {
        new Thread(producer2).start();
    }

    for (int i = 0; i < 30; i++) {
        new Thread(consumer).start();
    }
}
}
